/**
 * Author(s): xuming.Wong <xuming.Wong@gmail.com>
 */

#ifndef __G_PRIMITIVE_MANAGER_H__
#define __G_PRIMITIVE_MANAGER_H__

#include "NgPrerequisites.h"

namespace PQEngine
{

	class PrimitiveManager
	{
	protected:
		static const std::string SPHERE_MESH_NAME;
		static const std::string CUBE_MESH_NAME;
		static const std::string CYLINDER_MESH_NAME;

		static const std::string GIZMO_MESH_TRANSLATE;
		static const std::string GIZMO_MESH_ROTATE;
		static const std::string GIZMO_MESH_SCALE;

		PrimitiveManager();
	public:
		static PrimitiveManager& getSingleton();
		/*Force init PrimitiveManager
		*/
		inline std::string getSphereMeshName()
		{
			return SPHERE_MESH_NAME;
		}

		inline std::string getTranslateGizmoMeshName()
		{
			return GIZMO_MESH_TRANSLATE;
		}

		inline std::string getRotateGizmoMeshName()
		{
			return GIZMO_MESH_ROTATE;
		}

		inline std::string getScaleGizmoMeshName()
		{
			return GIZMO_MESH_SCALE;
		}

	private:
		void init();
		void createSphereMesh(std::string meshName,float radius, int nRings, int nSegments);
		void createCubeMesh(Ogre::String name, Ogre::String matName);

		//create transform gizmo mesh
		void createTransformGizmoMesh();
		void createTranslateGizmoMesh();
		void createTranslateArrow(Ogre::ManualObject *mesh);
		void createRotateGizmoMesh();
		void createRotateArrow(Ogre::ManualObject *mesh);
		void createScaleGizmoMesh();


	};
}
#define SPrimitiveManager PQEngine::PrimitiveManager::getSingleton()
#endif
